package com.eight.cloud.core.global.model;

import cn.hutool.core.util.ObjectUtil;
import com.eight.cloud.core.global.constant.DataScopeConstants;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.util.*;
import java.util.stream.Collectors;

/**
 * 用户信息
 *
 * @ClassName: UserInfo
 * @Author: TXC
 * @Date: 2024-10-08 16:56
 **/
@EqualsAndHashCode(callSuper = true)
@Data
public class LoginUser extends BaseUser implements Serializable {
    /**
     * 用户名
     */
    @NotBlank(message = "用户名不能为空")
    private String username;

    /**
     * 昵称
     */
    @NotBlank(message = "昵称不能为空")
    private String nickname;

    /**
     * 密码
     */
    @NotBlank(message = "密码不能为空")
    private String password;

    /**
     * 头像地址
     */
    private String headUrl;

    /**
     * 邮箱
     */
    @Email(message = "邮箱格式错误")
    private String email;

    /**
     * 电话
     */
    @NotBlank(message = "电话不能为空")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "无效的手机号码格式")
    private String telephone;

    /**
     * 工号
     */
    private String workNumber;

    /**
     * 性别 0：女  1：男  2：未知性别
     */
    private Integer sex;
}
